package org.dromara.merchants.domain.bo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import org.dromara.merchants.domain.TaAssociation;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

import java.util.List;

/**
 * 关联业务对象 ta_association
 *
 * @author xiyin321
 * @date 2024-07-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = TaAssociation.class, reverseConvertGenerate = false)
public class TaAssociationBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long associationId;

    /**
     * 父ID
     */
    @NotNull(message = "父ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long parentId;

    /**
     * 名称
     */
    @NotBlank(message = "名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 可选列表
     */
    @NotBlank(message = "可选列表不能为空", groups = { AddGroup.class, EditGroup.class })
    @TableField(typeHandler = JacksonTypeHandler.class,value = "options")
    private List<String> options;

    /**
     * 可选数量
     */
    @NotNull(message = "可选数量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long quantity;

    /**
     * 类型
     */
    @NotBlank(message = "类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String type;

}
